<template>
	<view class="list">
		<view class="record" v-for="(item,index) in list" :key="index">
			<view class="record_l">
				<view class="record_label">{{item.order_name}}({{item.buy_type}})</view>
				<view>{{item.recharge_time}}</view>
			</view>
			<view>
				<view class="record_money">{{item.recharge_amount}}</view>
				<view>{{item.pay_state}}</view>
			</view>
		</view>
		<view v-if="list.length==0" style="margin: 400rpx 0;text-align: center;">当前无数据</view>
	</view>
</template>

<script setup>
	import { computed ,ref,reactive,toRefs,onMounted} from 'vue';
	import { onLoad,onShow, onPageScroll, onPullDownRefresh } from '@dcloudio/uni-app';
	import sheep from '@/sheep';
	
	const list=ref()
	list.value=[]
	const userId=ref()
	userId.value=sheep.$store('user').userInfo.id
	console.log(userId.value);
	
	const getList=()=>{
		sheep.$api.login.purchaseRecord({userId:userId.value}).then(res=>{
			console.log(res);
			list.value=res.data.list
			console.log(list.value);
		})
	}
	
	onLoad(()=>{
		getList()
	})
</script>

<style lang="scss" scoped>
	page{
		padding: 30rpx;
	}
	.list{
		padding:30rpx;
		background-color: #fff;
		border-radius: 15rpx;
	}

	.record{
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding:20rpx 0;
		border-bottom: 2rpx solid #eee;
		font-size: 26rpx;
		color:#c1c1c1;
	}
	.record_label{
		margin-bottom: 10rpx;
		font-size: 30rpx;
		font-weight: 700;
		color: #000;
	}
	.record_l{
		width: 75%;
	}
	.record_money{
		font-size: 32rpx;
		font-weight: 700;
		color: #000;
		
	}
</style>